import lejos.nxt.*;
import lejos.nxt.comm.*;
import java.io.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Fredrik
 */
public class Ultrasonic extends Component {
    
    UltrasonicSensor sonic;
    
    public Ultrasonic() {
        this.sonic = new UltrasonicSensor(SensorPort.S1);
    }
    
    public int getValue() {
        return sonic.getDistance();
    }
    
}
